﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RoleSpeedMultiEffectItem : EffectItemBase,IInitByInstruction
{
	[SerializeField]
	float duration = 5;
	[SerializeField]
	float affect = 2;

	public void Init(BPInstruction instruction)
	{
		this.affect = float.Parse(instruction.Params[2]);
		this.duration = float.Parse(instruction.Params[3]);
	}

	protected override void EffectWithPlayer(RoleCtrl ctrl)
	{
		SpeedMultByTimeFactor speedByTimeFactor = new SpeedMultByTimeFactor(duration, affect);
		ctrl.RoleEntity.AddFactor(speedByTimeFactor);
	}
}
